package com.wzdigit.wms.basic.enums;

public enum QmsOqcStatusEnum implements BaseEnum {
    /**
     * 检验单状态
     */
    CHECK_WAIT_FOR_INSPECTION(101, "待检验","检验单状态"),
    CHECK_WORKING(102, "检验中","检验单状态"),
    CHECK_CONFIRM_INSPECTION(103, "确检中","检验单状态"),
    CHECK_REVIEWING(104, "评审中","检验单状态"),
    CHECK_ACCESS(105, "已通过","检验单状态"),
    CHECK_CONVICTED_BACK(106, "已判退","检验单状态"),


    /**
     * 判定结果
     */
    JUDGE_RESULT_SUCCESS(151, "判过","判定结果"),
    JUDGE_RESULT_FAIL(152, "判退","判定结果"),

    /**
     * 报检状态
     */
    WAITING_FOR_CHECK(201, "待报检","报检状态"),
    ALREADLY_CHECKED(202, "已报检","报检状态");

    private int code;
    private String enumName;
    private String description;

    QmsOqcStatusEnum(int code, String enumName, String description) {
        this.code = code;
        this.description = description;
        this.enumName = enumName;
    }

    public int getCode() {
        return this.code;
    }

    public String getEnumByName() {
        return this.enumName;
    }

    public String getDescription() {
        return this.description;
    }

    public static QmsOqcStatusEnum getEnumByCode(int enumCode) {
        QmsOqcStatusEnum[] values = QmsOqcStatusEnum.values();
        QmsOqcStatusEnum samplingEnum = null;

        for (QmsOqcStatusEnum value : values) {
            if (value.getCode() == enumCode) {
                samplingEnum = value;
            }
        }
        return samplingEnum;
    }
}
